package com.example.demo;

/**
 * @Author lizhien (zhien.li@nascent.cn)
 * @Date 2020/8/4 19:52
 * @Version 1.0.0
 * @Description com.example.demo
 */
import lombok.extern.slf4j.Slf4j;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class TopicConsumerListener {
    //topic模式的消费者
    @JmsListener(destination = "${spring.activemq.topic-name}", containerFactory = "topicListener")
    public void readActiveQueue(String message) {
        System.out.println("topic接受到：" + message);
//        log.info("topic接受到：" + message);
    }
}
